package com.aldobucchi.mxmlx
{
	import flash.events.EventDispatcher;
	import flash.events.Event;

	/**
	 * 
	 * 
	 * 
	 * function createLabel( trigger:Boolean ):String ( return new Date().toString(); );
	 * 
	 * <utils:DummyBindingTrigger id="trigger"/>
	 * <mx:Label text="{createLabel(trigger.trigger)}"/>
	 * 
	 * trigger.fire()  will update the label
	 * 
	 * @author aldo.bucchi@gmail.com
	 * 
	 */
	public class DummyBindingTrigger extends EventDispatcher
	{
		
		private var _trigger:Boolean = false;
		[Bindable("change")]
		public function get trigger():Boolean
		{
			return _trigger;
		}
	
		/**
		 * 
		 * This will toggle the value of the trigger property each time it is called
		 * false --> true --> false --> etc...
		 * 
		 * 
		 */		
		public function fire():void
		{
			_trigger = !_trigger;
			dispatchEvent( new Event( Event.CHANGE ) );
		}
		
	}
	
	
}